home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-20 | 3.8 KB | 158 lines | [TEXT/MPCC] |
- // ===========================================================================
- // <replace me PowerPlant>.cp ©1994, 1995 Metrowerks Inc. All rights reserved.
- // ===========================================================================
- // <replace me PowerPlant>.h (press Command-Tab to open the associated header)
- //
- // This file contains the starter code for a PowerPlant applicationd
-
-
-
- #include "<replace me PowerPlant>.h"
-
- #include <LWindow.h>
- #include <PP_Messages.h>
- #include <PP_Resources.h>
- #include <URegistrar.h>
- #include <PPobClasses.h>
- #include <LGrowZone.h>
- #include <UMemoryMgr.h>
- #include <UPowerTools.h>
- #include <LEditField.h>
-
- // put declarations for resource ids (ResIDTs) here
-
-
-
- // ===========================================================================
- // • Main Program
- // ===========================================================================
-
- void main(void)
- {
- // Set Debugging options
- #ifdef Debug_Throw
- gDebugThrow = debugAction_Alert;
- #endif
-
- #ifdef Debug_Signal
- gDebugSignal = debugAction_Alert;
- #endif
-
- InitializeHeap(4);
- InitializeToolbox();
- new LGrowZone(20000);
-
- CPPStarterApp theApp; // replace this with your App type
- theApp.Run();
- }
-
-
- // ---------------------------------------------------------------------------
- // • CPPStarterApp // replace this with your App type
- // ---------------------------------------------------------------------------
- // Constructor
-
- CPPStarterApp::CPPStarterApp()
- {
- // Register functions to create core PowerPlant classes
-
- RegisterAllPPClasses();
- }
-
-
- // ---------------------------------------------------------------------------
- // • ~CPPStarterApp // replace this with your App type
- // ---------------------------------------------------------------------------
- // Destructor
- //
-
- CPPStarterApp::~CPPStarterApp()
- {
- }
-
- // ---------------------------------------------------------------------------
- // • StartUp
- // ---------------------------------------------------------------------------
- // This function lets you do something when the application starts up.
- // For example, you could issue your own new command, or respond to a system
- // oDoc (open document) event.
-
- void
- CPPStarterApp::StartUp()
- {
- // ObeyCommand(cmd_New, nil); // example startup action
-
- }
-
- // ---------------------------------------------------------------------------
- // • ObeyCommand
- // ---------------------------------------------------------------------------
- // Respond to commands
-
- Boolean
- CPPStarterApp::ObeyCommand(
- CommandT inCommand,
- void *ioParam)
- {
- Boolean cmdHandled = true;
-
- switch (inCommand) {
-
- // Deal with command messages (defined in PP_Messages.h).
- // Any that you don't handle will be passed to the commander, LApplication
-
- /* // EXAMPLE:
-
- case cmd_New:
- LWindow *theWindow;
-
- // Edit_Window is a PPob, ResIDT defined above
- theWindow = LWindow::CreateWindow(Edit_Window, this);
- theWindow->Show();
- break;
-
- */
-
- default:
- cmdHandled = LApplication::ObeyCommand(inCommand, ioParam);
- break;
- }
-
- return cmdHandled;
- }
-
- // ---------------------------------------------------------------------------
- // • FindCommandStatus
- // ---------------------------------------------------------------------------
- // This function enables menu commands.
- //
-
- void
- CPPStarterApp::FindCommandStatus(
- CommandT inCommand,
- Boolean &outEnabled,
- Boolean &outUsesMark,
- Char16 &outMark,
- Str255 outName)
- {
-
- switch (inCommand) {
- // Return menu item status according to command messages.
- // Any that you don't handle will be passed to the commander, LApplication
-
- /* // EXAMPLE:
-
- case cmd_New:
- outEnabled = true; // enable the New command
- outUsesMark = false; // but it doesn't have a checkmark etc.
- break;
-
- */
-
- default:
- LApplication::FindCommandStatus(inCommand, outEnabled,
- outUsesMark, outMark, outName);
- break;
- }
- }
-